import java.io.Serializable;

public class Bus implements Serializable{
	private int numero;
	private int vitesse_courante;
	private String destination;
	private String position_courante;
	private String etat;	
		
	public Bus(int num,String pos,String dest,int vit,String etat){
		numero = num;
		vitesse_courante = vit;
		destination = dest;
		position_courante = pos;
		this.etat = etat;
	}
	
	public void modifieDestination(String dest){
		if (!dest.equals(null)) this.destination = dest.trim();
	}
	
	public void modifierVitesse(int ajout){
		vitesse_courante+=ajout;
	}

	public String getEtat() {
		return etat;
	}
	
	public int getNum(){
		return numero;
	}
	
	
	public synchronized String toString(){
		String res = "bus numero :"+numero+"\n";		
		res += "vitesse courante :"+vitesse_courante+"\n";
		res += "destination :"+destination+"\n";
		res += "position courante :"+position_courante+"\n";
		res += "etat :"+etat;
		return res;
	}
}
